<?php
extract ($data);
$articles = count($data['Article']);
$icon = $data['Upload'];

if(isset($Menus['url']) && !empty($Menus['url'])){
	$url = $Menus['url'];
}else{
	if($articles === 1 && isset($data['Article']['slug'])){
		//
		$url = '/a/'.$data['Article']['slug'];
	}else{
		$url = ($Menus['slug'] != '/' && $Menus['slug'] != "") ? array('plugin'=>false,'controller'=>false,'action'=>$Menus['slug']) : $Menus['slug'];
	}
}

if(is_array($icon) && isset($icon['name']) && !empty($icon['name'])){
	$image = $this->Html->image('/files/upload/images/'.$icon['name'],array('alt'=>$Menus['title'])).'<br/>';
}else{
	$image = "";
}

if(!is_array($url)){
	$external = (preg_match("/http/i", $url));
}else{
	$external = false;
}
$url = ($external) ? $url : $this->Html->url($url,true);

echo $this->Html->link(/*$image.*/$Menus['name'],$url ,array('title'=>$Menus['title'],'escape'=>false,'class'=>$Menus['css_class']));